package com.sylli.oeuf.server.db;

import java.util.Collection;

import com.sylli.oeuf.server.exception.BasedException;
import com.sylli.oeuf.server.object.transferable.BasedTO;

public abstract class AbstractProvider<T extends BasedTO> {
	
//	protected DatabaseCache<T> cache;
//	
//	private boolean cacheEnabled = true;
//	
//	public AbstractProvider(DatabaseCache<T> cache) {
//		if (cache == null) {
//			this.cacheEnabled = false;
//		} else {
//			this.cacheEnabled = true;
//			this.cache = cache;
//		}
//	}
//	
//	public boolean isCacheEnabled() {
//		return cacheEnabled;
//	}
//	
//	public void setCacheEnabled(boolean _val) {
//		cacheEnabled = _val;
//	}
	
	public abstract long create(T obj) throws BasedException;
	
	public abstract long[] create(Collection<T> obj) throws BasedException;
	
	public abstract void update(T obj) throws BasedException;
	
	public abstract void delete(String where_clause) throws BasedException;
	
	public abstract boolean exists(String where_clause) throws BasedException;
	
	public abstract T get(String where_clause) throws BasedException;
	
	public abstract Collection<T> getMultipleItem(String where_clause) throws BasedException;
	
}
